﻿using System;
using System.Collections.Generic;
using System.Text;
using FeCMS.Entity.AccessControlModule;


namespace FeCMS.AccessControlModule.handle
{
    /// <summary>
    ///     权限的控制
    /// </summary>
    internal class PermissionHandle : BaseHandle<Permission, int>
    {
        public PermissionHandle(Dictionary<int,Permission> obj) : base(obj)
        { 

        }


        /// <summary>
        ///     添加权限
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public override int Add(Permission e)
        {
            int id = SetDelegateGetIndex(HandleType.Permission);
            e.ID = id;
            if (Add(id, e))
            {
                return id;
            }
            else
            {
                return -1;
            }
        }
    }
}
